#include "thread.h"

bool is_invisible_char(char c) {
    return !isprint((unsigned char)c);
}

int remove_trailing_invisible_chars(char *str) {
    int len = strlen(str);
    while (len > 0 && is_invisible_char(str[len - 1])) {
        str[len - 1] = '\0';
        len--;
    }
    return 0;
}
